<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="__ROOT__/Public/Admin/css/shortcut icon" href="favicon.ico">
    <link href="__ROOT__/Public/Admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/animate.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/js/plugins/cityPicker/city-picker.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/edit.css" rel="stylesheet"/>

<style>
.form-control {
	display:inline-block;
}
.PonitCSS{
	font-size:12px;
	height:30px !important;
	width:260px;
	display:inline-block;
	position: absolute;
}
</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
       
        <div class="row">
            <form class="form-horizontal m-t js-ajax-forms" id="signupForm" action="/index.php?m=Admin&c=ProjectScore<if condition="$editdata">&a=update<else />&a=add</if>" method="post" enctype="multipart/form-data">
           	<input type="hidden" name="ID" value="{$editdata['ID']}">
            <div class="col-sm-8  col-md-offset-2">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">项目名称 * </label>
                                <div class="col-sm-8">
                                	<select class="form-control" id="ProjectID" name="ProjectID" aria-required="true" aria-invalid="true" class="error">
	                                	<?php
	                                		foreach($data AS $k => $v){
	                                	?>
	                                	<option <?php if($v['ID'] == $projectID){echo 'selected';}else{ echo 'disabled';} ?> value="<?php echo $v['ID']?>"><?php echo $v['Name']?></option>
	                                	<?php
	                                		}
	                                	?>
	                                </select>
                                </div> 
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">需求确认分数</label>
                                <div class="col-sm-8">
                                    <input id="Point1" name="Point1" class="form-control" type="text"  value="{$editdata.Point1}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">立项确认分数</label>
                                <div class="col-sm-8">
                                    <input id="Point2" name="Point2" class="form-control" type="text"  value="{$editdata.Point2}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">招投标或启动前对接分数</label>
                                <div class="col-sm-8">
                                    <input id="Point3" name="Point3" class="form-control" type="text"  value="{$editdata.Point3}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">项目启动分数</label>
                                <div class="col-sm-8">
                                    <input id="Point4" name="Point4" class="form-control" type="text"  value="{$editdata.Point4}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">过程管控与需求变更分数</label>
                                <div class="col-sm-8">
                                    <input id="Point5" name="Point5" class="form-control" type="text"  value="{$editdata.Point5}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">结果文档分数</label>
                                <div class="col-sm-8">
                                    <input id="Point6" name="Point6" class="form-control" type="text"  value="{$editdata.Point6}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">项目验收与总结分数</label>
                                <div class="col-sm-8">
                                    <input id="Point7" name="Point7" class="form-control" type="text"  value="{$editdata.Point7}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-4 control-label">项目延续性分数</label>
                                <div class="col-sm-8">
                                    <input id="Point8" name="Point8" class="form-control" type="text"  value="{$editdata.Point8}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-4">
                                    <button class="btn btn-primary keep" type="submit">保存</button>
                                    <a class="btn btn-white" href="javascript:void(0);" onclick="self.location=document.referrer;">返回</a>
                                </div>
                            </div>
                        
                    </div>
                </div>
            </div>
           
            </form>
        </div>
    </div>
    

	<script src="__ROOT__/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
	<script src="__ROOT__/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/layer/laydate/laydate.js"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="__ROOT__/Public/Admin/js/ajaxForm.js"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.min.js"></script>
	
	<link href="__ROOT__/Public/Admin/css/selector/selectorstyle.css" rel="stylesheet"/>
	<script src="__ROOT__/Public/Admin/js/plugins/selector/selector.js"></script>
 	<script src="__ROOT__/Public/Admin/js/plugins/selector/jquery.ztree.all.js"></script>
 	
	<script>
		$(document).ready(function () {
			$.extend($.validator.messages, {
				number: "请输入合法的数字"
			});
			var icon = "<i class='fa fa-times-circle'></i>";
			var form = $('form.js-ajax-forms');
			var formloading = false;
			form.validate({
		        //验证规则
		        rules: {
		            ProjectID: {
		                required: true
		            },Point1: {
                   		number: true
                	},Point2: {
                   		number: true
                	},Point3: {
                   		number: true
                	},Point4: {
                   		number: true
                	},Point5: {
                   		number: true
                	},Point6: {
                   		number: true
                	},Point7: {
                   		number: true
                	},Point8: {
                   		number: true
                	}
		        },
		        //验证未通过提示消息
		        messages: {
		            ProjectID:{
		                required: icon + "请选择项目名称"
		            }
		        },
		        //验证通过，提交表单
		        submitHandler : function(forms) {
		        	if (formloading)
	                return;
		            $(forms).ajaxSubmit({
		                url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
		                dataType : 'json',
		                beforeSubmit : function(arr, $form, options) {
		                    formloading = true;
		                },
		                success : function(data, statusText, xhr, $form) {
		                    formloading = false;
		                    if (data.status) {
		                        //添加成功
		                        swal({
		                            title: "继续操作？",
		                            text: "操作成功！",
		                            type: "success",
		                            showCancelButton: true,
		                            confirmButtonColor: "#DD6B55",
		                            confirmButtonText: "确认",
		                            cancelButtonText: "返回",
		                            closeOnConfirm: false,
		                            closeOnCancel: false
		                        },
		                        function (isConfirm) {
		                            if (isConfirm) {
		                                document.location.reload();
		                            } else {
		                                document.location.href = "{:U('ProjectEvaluate/index')}&id="+parent.projectID;
		                                //self.location=document.referrer;
		                                return true;
		                            }
		                        }); 
		                    } else {
		                        swal("操作失败", data.info, "error");
		                    }
		                }
		            });
		        }
		    });
		});
		
		//办理过程
        var busid = '{$busid}';
		var formid = '{$formid}';
		var taskID = parent.taskID;
        if(busid != null){
        	data = {
        		"busid":busid,
        		"formid":formid
        	}
			$(".loading").show();
        	$.post("{:U('Admin/TaskProcess/getRihtByXid')}",data,function(result){
        		$(".loading").hide();
        		for(var k in result){
        			switch(result[k].RightType){
        				case "0":
        					$("#"+result[k].IDName).parent().parent().css("display","none");
        					break;
        				case "1":
        					$("#"+result[k].IDName).attr("readonly",true);
        					$("#"+result[k].IDName).attr("disabled",true);
        					$("#"+result[k].IDName).attr("class","form-control");
        					break;
        				case "2":
        					break;
        				default:
        					break;
        			}
        		}
        	});
        }
        if(taskID != null){
        	$(".taskID").val(taskID);
        }
         
	</script>
</body>

</html>
